<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script language="javascript" type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
function openwindow(str)
{
  window.open("doTree.jsp?sid="+str+"&pd=","部门","height=380,width=260,top=230,left=450,scrollbars=yes"); 
   //showModalDialog("doTree.jsp","部门","height=380,width=260,top=230,left=250,scrollbars=yes");
}
function yz(){
		var bmbh=document.getElementById("bmbh").value;
		if(bmbh=="")
		{
		alert("请选择部门");
		return false;
		}else if(document.getElementById("startNl").value==""||document.getElementById("endNl").value==""||document.getElementById("nljg").value==""){alert("请输入年龄");
		return false;
		}else{
		self.parent.tb_remove();
		return true;
		}
	}
function yznl(falg){
	if(falg==1){
		if(isNaN(document.getElementById("startNl").value)==true)
		{
			alert("年龄必须是数字");
			document.getElementById("startNl").value="";
		}
	}
	if(falg==2){
		if(isNaN(document.getElementById("endNl").value)==true)
		{
			alert("年龄必须是数字");
			document.getElementById("endNl").value="";
			
		}
		if(parseInt(document.getElementById("endNl").value)<=parseInt(document.getElementById("startNl").value)){
			alert("终止年龄必须大于起始年龄");
			document.getElementById("endNl").value="";
		}
	}
	if(falg==3){
		if(isNaN(document.getElementById("nljg").value)==true)
		{
			alert("年龄必须是数字");
			document.getElementById("nljg").value="";
		}
		if(parseInt(document.getElementById("nljg").value)>parseInt(document.getElementById("endNl").value)){
			alert("年龄间隔必须小于终止年龄");
			document.getElementById("nljg").value="";
		}
	}
}
</script>
</head>

<body>
<form id="form1" name="form1" method="post" action="zdyryqk.do"  onsubmit="return yz();self.parent.tb_remove();">
  <p>
    <input type="hidden" value="" name="falg" id="falg"/>
请选择单位：
  
  
  <input type="text" name="bm" id="bm"  class="SmallInput" onclick="openwindow(1)"  disabled="disabled"/>
  <a href="javascript:openwindow(1);">选择<br />
  </a> 　起始年龄：
  <input name="startNl" type="text"  class="SmallInput" id="startNl" size="5" maxlength="3" onchange="yznl(1)"/>
  <br />
    　终止年龄：
    <input name="endNl" type="text"  class="SmallInput" id="endNl" size="5" maxlength="3" onchange="yznl(2)"/>
    <br />
  　年龄间隔：
  <input name="nljg" type="text"  class="SmallInput" id="nljg" size="5" maxlength="3"  onchange="yznl(3)"/>
  </p>
  <p>
    <input type="submit" name="button" id="button" value="查看统计表"  onclick="document.getElementById('falg').value='';"/>
    <input type="submit" name="button2" id="button2" value="查看统计图"  onclick="document.getElementById('falg').value=1;"/>
    <input type="hidden" id ="bmbh" name="bmbh"  />
      </p>
</form>
</body>
</html>
